var http = require('http')
// var path = require('path')

var server = http.createServer((request, response)=>{
  //  var extname = path.extname(request.url)
  //  console.log(extname)
  // response.write(request.url)
  // response.write('hello word')
  // response.end()
  if(request.url === '/postform' && request.method.toLowerCase === 'post'){
    console.log(request.url, request.method)
    var allData = ''
    request.addListener('data',function(chunk){
      allData += chunk
    })
   request.addListener('end', function(){
    console.log(allData.toString())
   })
  response.end('helow')


  }
})

server.listen(3003,'127.0.0.1')  
console.log(`server start on http://127.0.0.1:3000`)


// 缓存问题